bitkeeper revision 1.1159.63.1 (412f7bbf5smbnLknRPslkbedgaBzzw)
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Fri, 27 Aug 2004 18:21:51 +0000 (18:21 +0000)
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Fri, 27 Aug 2004 18:21:51 +0000 (18:21 +0000)
Only update the tls descriptors if they are changed.

linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/process.c

index 11cba277345cefaa7d98aef595eab5031801e71f..75816caf325c2e482b32eac707bcd288ce48a054 100644 (file)
@@ -556,7 +556,15 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
         * Load the per-thread Thread-Local Storage descriptor.
         * This is load_TLS(next, cpu) with multicalls.
         */
-#define C(i) queue_multicall3(__HYPERVISOR_update_descriptor, virt_to_machine(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i]), ((u32 *)&next->tls_array[i])[0], ((u32 *)&next->tls_array[i])[1])
+#define C(i) do {                                                          \
+       if (unlikely(next->tls_array[i].a != prev->tls_array[i].a ||        \
+                    next->tls_array[i].b != prev->tls_array[i].b))         \
+               queue_multicall3(__HYPERVISOR_update_descriptor,            \
+                                virt_to_machine(&get_cpu_gdt_table(cpu)    \
+                                                [GDT_ENTRY_TLS_MIN + i]),  \
+                                ((u32 *)&next->tls_array[i])[0],           \
+                                ((u32 *)&next->tls_array[i])[1]);          \
+} while (0)
        C(0); C(1); C(2);
 #undef C